-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: preset-vue #2143
fix: preset-vue #2143
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
+1 |
src/loaders/markdown/index.ts
Outdated
@@ -188,7 +188,7 @@ export const demos = { | |||
// omit entry file | |||
...(key !== entryFileName | |||
? { | |||
[key]: `{{{require('${path}')}}}`, | |||
[key]: `{{{import('${path}')}}}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个方案感觉不太好,会导致依赖变异步,以及不必要的 chunk 拆分;还不如在这里对 path 重新 resolve 一遍
cc @Jinbao1001
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里暂时的异步没关系吧,expandDemoContext
那里会await一下。chunk拆分倒是没考虑到。
const resolver = enhancedResolve.create.sync({ | ||
mainFields: ['browser', 'module', 'main'], | ||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'], | ||
conditionNames: ['import', 'default', 'browser'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conditionNames要不要和项目已有保持一致: ['import', 'require', 'default', 'browser', 'node']
This reverts commit 4ab098a.
* fix: repository field may be empty * fix: give unique filename for each demo * fix: limit the resolve rule to the demo * fix: vue jsx import isssue * fix: multi vue instance issue in mfsu mode * chore: remove comments * feat: support lastest vue * fix: vue live demo * feat: using import instead of require for demo context * fix: use singleton vue * refactor: avoid unnecessary chunk split
+1, currently still exists. fatal - TypeError: Cannot read properties of undefined (reading 'directory') |
* fix: preset-vue (#2143) * fix: repository field may be empty * fix: give unique filename for each demo * fix: limit the resolve rule to the demo * fix: vue jsx import isssue * fix: multi vue instance issue in mfsu mode * chore: remove comments * feat: support lastest vue * fix: vue live demo * feat: using import instead of require for demo context * fix: use singleton vue * refactor: avoid unnecessary chunk split * fix: illegal characters in the path under Windows `:` should not allowed to be contained in `api.key` cause it may be used in `api.writeTmpFile` #2188 * fix: the include/exclude in webpack needs to correspond to the path format of the system
* fix: preset-vue (#2143) * fix: repository field may be empty * fix: give unique filename for each demo * fix: limit the resolve rule to the demo * fix: vue jsx import isssue * fix: multi vue instance issue in mfsu mode * chore: remove comments * feat: support lastest vue * fix: vue live demo * feat: using import instead of require for demo context * fix: use singleton vue * refactor: avoid unnecessary chunk split * fix: illegal characters in the path under Windows `:` should not allowed to be contained in `api.key` cause it may be used in `api.writeTmpFile` #2188 * fix: the include/exclude in webpack needs to correspond to the path format of the system * feat: add basic vue lib template * feat: improve vue tempalte * fix: template test file impact
🤔 这个变动的性质是?/ What is the nature of this change?
🔗 相关 Issue / Related Issue
#2141
💡 需求背景和解决方案 / Background or solution
preset-vue引入的问题
@makotot/ghostui/src/Scrollspy
引入问题(即从node_modules引入tsx)更改为
mfsu 依赖搜集机制所导致的vue及外部依赖产生多个实例
@PeachScript @Jinbao1001
📝 更新日志 / Changelog